﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Infusion.Silverlight.Controls.OpenOfficeXML
{
    #region : OpenXMLHelper :
    public class OpenXMLHelper
    {
        #region Constants...
        public const double PointsToPixelsMultiplier = 20d / 15d;
        #endregion

        #region ConvertPointsToPixels
        public static double ConvertPointsToPixels(int points)
        {
            return Convert.ToDouble(points) * PointsToPixelsMultiplier;
        }
        #endregion

        #region ConvertPointsToUnits
        public static double ConvertPointsToUnits(DocumentUnit unit, int points)
        {
            double size = 0d;

            switch (unit)
            {
                case DocumentUnit.Inches: // 1 inch = 72 points
                    size = Convert.ToDouble(points) / 72d;
                    break;
                default:
                    break;
            }

            return size;
        }
        #endregion
    }
    #endregion
}